package com.terry.test2.dp;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.Getter;

import javax.xml.bind.ValidationException;

/**
 * @author 小八
 * @date 2023年02月01日15:18
 */
@Data
public class Currency {
    @Getter
    private final String currency;
    public Currency(String currency) throws ValidationException {
        //1.可通过validation  @Empty实现
        if(ObjectUtil.isEmpty(currency)){
            throw new ValidationException("currency不能为空");
        }
        this.currency = currency;
    }

    public boolean equals(Currency currency){
        if(this.currency.equals(currency)){
            return true ;
        }
        return false;
    }

}
